package org.jackysoft.query;

public enum CompareRelation {
	等于("=")
	, 不等于("!=")
	, 小于("<")
	, 大于等于(">=")
	, 大于(">")
	, 小于等于("<=")
	, 类似于("like")
	//不同值用分号分割 a;b;c;d;e
	, 在其中("in");

	private String qs = "=";

	CompareRelation(String qs) {
		this.qs = qs;

	}

	@Override
	public String toString() {
		return this.qs;
	}

	public String getName() {
		return this.name();
	}

	public String getValue() {
		return this.qs;
	}

	public static String getOptions() {
		String opts = "";
		for (CompareRelation c : CompareRelation.values()) {
			opts += String.format("<option value='%s'>%s</option>", c.name(),
					c.name());

		}
		return opts;

	}
}
